-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADD Custom color scheme API #839
Conversation
Hello, |
@sperezconesa I personally don't know "how". @arose Do you have any suggestion? thanks. |
Hi, I can't get this example to work in Colab (works in local notebooks though). Is there a way to do custom coloring by residue in colab? Here is the code I tried. Output from colab was a completely white structure Cell 1
Cell 2
|
hi @seanrjohnson, there is nothing we can do about colab besides waiting for google to improve it. |
This seems to be the only effective way at present. nglview/nglview/tests/test_widget.py Line 442 in a0b53a4
|
Is this also supported for surfaces? I can't seem to get it to work. The surface gets created, but it is all white. It does work for the cartoon representation.
|
@mretier would you mind ask something like 'is is possible to custom color of the surface repr or not?', in cheers. |
thanks @mretier |
@hainm please check out the response in the above mentioned thread. It appears to be possible. |
@mretier You are using |
@hainm yes, it was my intention in this specific case. When using the same code to apply to the cartoon representation it worked |
@mretier I've made a comment here, is that similar to what you're trying? nglviewer/ngl#1005 (comment) |
@hainm thanks for the comment. I was able to reproduce your results. Howevever, it does not seem to work with my own code that's a bit different. It's not clear to me why it wouldn't work in my case:
|
May be your atom selection is not right?
Hai
…On Sun, Dec 10, 2023 at 3:03 PM Michael Reiter ***@***.***> wrote:
@hainm <https://github.com/hainm> thanks for the comment. I was able to
reproduce your results. Howevever, it does not seem to work with my own
code that's a bit different. It's not clear to me why it wouldn't work in
my case:
import nglview as nv
from Bio.PDB import *
# new cell
parser = PDBParser()
# load Zymomonas mobilis alcohol dehydrogenase
Zmadh = parser.get_structure('3OWO', './3owo_Zmadh.pdb')
# remove second dimer structure
Zmadh[0].detach_child('C')
Zmadh[0].detach_child('D')
—
Reply to this email directly, view it on GitHub
<#839 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABB645JO4YENUHBARAXGFIDYIYIQPAVCNFSM4IIWRPXKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBUHEYDMNZUGM3A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@hainm could you elaborate what exactly you mean? How would if find out if my selection was incorrect? |
Can you please provide exact code + data so I can reproduce your issue?
Hai
…On Fri, Dec 15, 2023 at 10:00 AM Michael Reiter ***@***.***> wrote:
@hainm <https://github.com/hainm> could you elaborate what exactly you
mean? How would if find out if my selection was incorrect?
—
Reply to this email directly, view it on GitHub
<#839 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABB645II6RN57VCLKLYVYZLYJRQZ7AVCNFSM4IIWRPXKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBVHAYDCOJWGAZA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@hainm thanks for your effort, the above code should be fully functional. For your convenience I attached the full code here as well as the .pdb file. |
I could reproduce the issue with your code + file. Let me play more with it. Cheers. |
A live version here: https://nbviewer.jupyter.org/github/arose/nglview/blob/644fa66a8461b52c01a5e4df4d2a99486b690fea/notebooks/custom_color.ipynb
(might need to Zoom Out to see the full page: #840 )
Code
Selection Scheme
Function